<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: install.php 8889 2010-04-23 07:48:22Z monkey $
 */
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

$sql = <<<EOF

DROP TABLE IF EXISTS pre_er_accountcenter_user;
create table pre_er_accountcenter_user
(
    id          int auto_increment
        primary key,
    uid         int                                           not null,
    erling_unionid       varchar(64)                   null comment '',
    access_token         varchar(255)                   null comment '令牌',
    status      tinyint(3)                  default 3         null comment '1正常、2异常',
    create_time int                                           null comment '创建时间',
    update_time int                                           null comment '更新时间'
)
    engine = InnoDB;
    
DROP TABLE IF EXISTS pre_er_accountcenter_config;
create table pre_er_accountcenter_config
(
    id     int auto_increment
        primary key,
    `key`  varchar(50)  null,
    name   varchar(50)  null,
    value  text         null,
    `desc` varchar(255) null,
    constraint pre_er_accountcenter_config_pk
        unique (`key`)
)
    engine = InnoDB;

INSERT INTO pre_er_accountcenter_config (`key`, name, value, `desc`) VALUES 
('redirect_url', '重定向URL', 'http://discuz.demo', '授权成功后跳转的URL'),
('appid', '应用ID', '123456', '第三方应用的APPID'),
('app_secret', '应用密钥', '123456', '第三方应用的密钥'),
('only_acount_auth', '只允许聚合账号登录', '0', '0:不限制,1:限制');

EOF;

runquery($sql);


$finish = TRUE;

?>